<?php
require_once(dirname(__FILE__)."/../lib/Loader.php");
cfgload("defines");
cload("Smarty.smartyRenderer");
cload("requestProcessor");
cload("templatesData.templateList");

/**
 * Description of admTemplatesList
 *
 * @author Di_Moon
 */
class admTemplatesList extends smartyRenderer {
    protected $_dbh;
    
    function __construct($dbh) {
        parent::__construct();
        
        $this->_dbh = $dbh;
    }
    
    function render() {
        $list = new templateList($this->_dbh);
        $listArr = $list->getList();
        
        $listArrTpl = array();
        for($i=0;$i<sizeof($listArr);$i++) {
            array_push($listArrTpl, $listArr[$i]->getElements());
        }
        
        $this->assign("listArr", $listArrTpl);
        
        return $this->fetch("admTemplatesList.tpl");
    }
}

?>
